<template>
  <div class="wrapper">
    <div class="store_item rd-8" v-for="item in storeList" :key="item.id">
      <div class="head" @click="gopage(item)">
        <div class="left_wrapper">
          <div class="logo">
            <el-image class="img" fit="scale-down" :src="item.avatar">
              <div slot="placeholder" class="image-slot">
                loading<span class="dot">...</span>
              </div>
            </el-image>
          </div>
          <div class="con_box">
            <div class="title">
              {{ item.name }}
            </div>
            <div class="start_box">
              <!-- <el-rate v-model="item.starLevel" disabled :colors="colors" text-color="#00785E"></el-rate> -->
              <el-rate 
                v-model="item.starLevel"
                disabled
                :icon-classes="['iconfont2 ic-pingfen active-iconfont2','iconfont2 ic-pingfen active-iconfont2','iconfont2 ic-pingfen active-iconfont2']"
                :void-icon-class="'iconfont2 ic-pingfen'"
                :disabled-void-icon-class="'iconfont2 ic-pingfen'"
              >
              </el-rate>
            </div>
          </div>
        </div>
        <div class="right_wrapper">
          <!-- <span class="iconfont icon-shangjiadingdan"></span> -->
          <span class="name">{{ $t(`page.goodsSearch.mer`) }}</span>
        </div>
      </div>
      <div class="pic_wrapper">
        <div class="proList" @click="goDetail(items)" v-for="items in item.proList" :key="items.id">
          <div class="pic_item">
            <el-image class="img" fit="scale-down" :src="items.image">
              <div slot="placeholder" class="image-slot">
                loading<span class="dot">...</span>
              </div>
            </el-image>
          </div>
          <div class="title lines1">
            {{ items.storeName }}
          </div>
          <div class="price">
            <statistic :value="items.price" :currency="items.currency" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { goShopDetail, goMerchant } from '@/utils/order.js';
export default {
  name: "store",
  props: {
    storeList: {
      type: Array,
      default: function () {
        return [];
      }
    }
  },
  data() {
    return {
      colors: ['#99A9BF', '#00785E', '#00785E']
    }

  },
  methods: {
    gopage(item) {
      goMerchant(item.id, this);
    },
    goDetail(items) {
      goShopDetail(items.id, this);
    },
  }
};
</script>
<style lang="scss" scoped>
@import '@/assets/css/variables.scss';

.wrapper {
  display: flex;
  flex-wrap: wrap;
  // justify-content: space-between;
  justify-content: flex-start;

  .store_item:nth-child(odd) {
    margin-right: 16px;
  }

  .store_item {
    width: 592px;
    height: 360px;
    padding: 16px;
    display: inline-block;
    margin-bottom: 16px;
    background-color: #fff;
    // border: 1px solid #DDDDDD;
    // background: url('../assets/images/storelist.png') no-repeat;
    // background-size: 100%;
    // margin-right: 15px;

    .head {
      margin-bottom: 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;

      .left_wrapper {
        display: flex;

        .logo {
          .img {
            width: 70px;
            height: 70px;
            border-radius: 8px;
            margin-right: 17px;
            border: 1px solid #D9DFE7;
          }
        }

        .con_box {

          // display: flex;
          .title {
            margin: 12px 0 10px 0;
          }
        }
      }

      .right_wrapper {
        color: $user--color-primary;
        background: #E5F1EE;
        border-radius: 4px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        width: 88px;
        height: 37px;
        line-height: 37px;
        font-weight: 500;

        .name {
          margin-left: 2px;
        }

        i {
          margin-right: 6px;
        }

        span {
          font-size: 12px;
          font-family: ArialMT;
          color: #00785E;
        }
      }
    }

    .pic_wrapper {
      display: flex;
      justify-content: flex-start;

      .proList {
        width: 176px;
        margin-right: 16px;
        cursor: pointer;
        background-color: #F5F7FA;
        padding: 8px;
        border-radius: 8px;

        .pic_item {
          width: 160px;
          height: 160px;

          .img {
            width: 100%;
            height: 100%;
            border-radius: 8px;
            background-color: #fff;
          }
        }

        .title {
          margin: 10px 0;
          font-size: 16px;
          font-family: ArialMT;
          color: #333333;
          line-height: 22px;
        }

        .lines1 {
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 1;
          -webkit-box-orient: vertical;
        }

        .price {
          font-size: 18px;
          font-family: DINCond-Black, DINCond;
          font-weight: 900;
          color: #00785E;
          line-height: 18px;
        }
      }
    }
  }
}
</style>

